<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Notice extends Model
{
	protected $table='noitce';

	public $delay_type_arr = [
		1 => '每时',
		2 => '每天',
		3 => '每周',
		// 4 => '每月'
	];

	public $notice_type_arr = [
		0 => '默认',
		64=> '提醒',
		48=> '警告'
	];

	public function getContentAttribute($value)
    {
        return array_values(json_decode($value, true) ?: []);
    }

    public function setContentAttribute($value)
    {
        $this->attributes['content'] = json_encode(array_values($value));
    }
}